// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "assert.h"

#include "chainparams.h"
#include "core.h"
#include "protocol.h"
#include "util.h"

//
// Main network
//

unsigned int pnSeed[] =
{
    0x677c98c8, 0x29b9b992, 0x5bc3f6da, 0x829a3eb2, 0x2cbbe85b, 0xd8e4e2bc, 0xa0cfa5bc, 0x4a2e555f,
    0x6d988705, 0x80a03eb2, 0x8d940b48, 0x5ab6b95d, 0x0e431c45, 0xf77ddf4e, 0xbdc3d23e, 0xd757b205,
    0x0e08f568, 0xb075c7c6, 0x78be1a6c, 0xf73009b0, 0x55efaa6b, 0xbf58e462, 0x431d8368, 0x431d8368,
    0x4db2528b, 0x5c144ddb, 0x97d59dc0, 0xe580e068, 0x0933dc1f, 0xab745c57, 0x90e9156b, 0x431eb658,
    0x2f227161, 0xebd9f25e, 0x23e5c14e, 0xaca34305, 0x5713a4d8, 0xd683b992, 0xe48bc22e, 0xc7fc7ec8,
    0x5ae0574f, 0x0f58e9bc, 0x2b35ec68, 0x86fcaab4, 0x1ff340d5, 0x8c5cc818, 0xad0be9bc, 0xcd5cd454,
    0x6071aa7a, 0x7c561dde, 0xaa0e0977, 0x502de15a, 0x37bd1dd9, 0x8418492e, 0xa78b2002, 0x45dae64e,
    0x84a67870, 0xa7ee2c79, 0x0353be6d, 0x22b2528b, 0x22b2528b, 0x3db2528b, 0x4122555f, 0x75af3851,
    0xa6ea09b0, 0xaec8cc47, 0x086b726a, 0xdc8a2442, 0x165df950, 0xdf19ca5b, 0xce565c57, 0xf1b47fd5,
    0x8ab4795b, 0x89ffba32, 0x25a7e9bc, 0x48261a3d, 0x387e692e, 0xec7c45c0, 0x48c5e052, 0x88b91faf,
    0xe8c22f5b, 0x3f5e9c5a, 0xb2ecd048, 0xe40ec273, 0x3df27abb, 0x85d7d05c, 0xc7f07abb, 0x07e84b58,
    0x199fc257, 0xd85ce362, 0x9a1114de, 0x09f2a57b, 0x778ad54e, 0x35842002, 0x817f0451, 0x2d0d795b,
    0x4d0ed31b, 0x0eb31b3c, 0xad51294f, 0x44bb48de, 0x8e50e08c, 0x4d154ddb, 0x04adb97b, 0x344dfd54,
    0xb9419cba, 0x41671bb2, 0x5dc27161, 0xa08ad54e, 0xca56972e, 0xc49e206e, 0x30aa7e7c, 0x03b48049,
    0x543eddd8, 0x50161a3d, 0xe03c4fda, 0x2b22037b, 0xdfd7144d, 0xf3035272, 0xfc455d72, 0xf3e7ba58,
    0xc5aba33e, 0x02e71dc9, 0xca56c082, 0x92c2f4dc, 0x323a524f, 0x8885cc25, 0xb94b993a, 0xfa5c7b7b,
    0x3ebd13c9, 0xf0552644, 0x8d5f14de, 0x7ffc0649, 0x91159025, 0x258a0e74, 0x5b24aa58, 0x949b193c,
    0xfb61fc6d, 0x6b5e787d, 0xbcab5c4b, 0x7894f472, 0x1a2c0557, 0x5909475f, 0x06fbd05e, 0x132dbe6d,
    0x59e39f2a, 0x207e3146, 0xf022c2bc, 0x157df23c, 0xaab5de5e, 0x1f131c5a, 0x148c0e74, 0x31b4ce4e,
    0x4289206e, 0x6d25105a, 0x6a48b756, 0xa8aa4273, 0x0a8d1dda, 0xdcc41dc9, 0x60685a58, 0x7b83ea7c,
    0x124d135d, 0xd1bfb87c, 0x8d0966bc, 0x179e1c05, 0xcc10404a, 0x4e46c281, 0x2f37be6d, 0x10a8c16f,
    0x0aabdadd, 0x4a9d0e7d, 0xdd91ff92, 0x4c51e08c, 0x1b8ad35f, 0xd369da57, 0x32596670, 0x6d419f7a,
    0x4e9100b2, 0x8b4fba43, 0x2267dc57, 0x4ef5d73a, 0x708d4559, 0x58ceeb7c, 0xc3239c45, 0x5aa77870,
    0xef2d0f1b, 0x385ae26d, 0x194b5d72, 0x79b10cb2, 0x1212b37c, 0xadbd5252, 0xaa48993a, 0x3ea1313a,
    0x34d3846d, 0x18af0e74, 0xd3500525, 0xeec4ba56, 0x29eafb47, 0x6ebd5252, 0xe06f407c, 0xdc469c7b,
    0xbcc0206e, 0x61c31f5d, 0x92bc5252, 0x9bbd3f6d, 0x95ba5054, 0xada6df5e, 0x57bd5252, 0xfee0533e,
    0x9520f4bc, 0xe3be1dc9, 0xc0ea8edb, 0xab20bd1b, 0x86ca206e, 0xcd6e777d, 0x33af7631, 0x6237787b,
    0x693f91df, 0x37b5a056, 0xc02fa43a, 0xd2465d72, 0x63bd7a7d, 0x35497059, 0xb5a6505d, 0x98497059,
    0x9343cf5b, 0xff247059, 0xf999144d, 0x5b78ecb3, 0x1395f1ba, 0x3cf32b43, 0x43139ab4, 0x4e65527b,
    0xd4bdea4e, 0x3948e38b, 0xfed7c173, 0xd6469c7b, 0xf8a3b87c, 0xa2409c7b, 0x09f547b2, 0x51c7206e,
    0x32a7767d, 0xda0b6cbc, 0x04f27abb, 0x898aa53d, 0xc69b206e, 0xe7fa9d6d, 0x9b69695c, 0x608b20bc,
    0x4840733b, 0xaf2c61b1, 0x55bd5252, 0x49a2301f, 0x0e6fd836, 0x3912c8b6, 0x5cb980de, 0xb8a208af,
    0xb8534c71, 0x06436bab, 0x53a3135d, 0xa79ab07c, 0x5993d46d, 0xbfe60c1b, 0x1395f1ba, 0xd7485393,
    0x2e0051bc, 0x7c93a56f, 0x8aae1b42, 0x8eaa0e74, 0x5e7eecb3, 0xe0d4e872, 0x4540c86e, 0x8d5a135e,
    0x146068ab, 0xf5e40355, 0x4b14b143, 0x0cbd4adb, 0x9d9f80db, 0xef74ab75, 0x3340e063, 0xdd9b2eb7,
    0x4ef51f5f, 0x890bf572, 0xe3a24578, 0x676d4471, 0x296a6d2e, 0xdf500c87, 0x989ab54f, 0x706b5d02,
    0x4c4ba4dc, 0x3929b2cd, 0x6d6d4471, 0x61c61955, 0x9d893251, 0x4a6f3fb7, 0x93de5658, 0xeb00576e,
    0x0a13eabc, 0xacb7f5dc, 0x13802442, 0xdfc55731, 0xbd0f737b, 0xc94b475f, 0xbbcb482e, 0x4c14ed5c,
    0x68f4cd2e, 0xc2f77abb, 0x2a437ebb, 0x27810477, 0x63d667d5, 0xa047af6f, 0x9f9e2eb7, 0xaf8900af,
    0xc5740a1b, 0xb6367059, 0xab982eb7, 0xaca4598f, 0xc607e852, 0x8e11af6f, 0xf09cf671, 0x32794ac6,
    0xaebbc8b6, 0xfacd67d3, 0xb45508b9, 0xd9a3dd57, 0x4e431979, 0x8b7d4fda, 0x0395a56f, 0xdc1ba9dc,
    0xbb9b2eb7, 0xfacaa277, 0x6fa5b97c, 0x925c7670, 0xc282b455, 0x7ffbf152, 0x1113ee4e, 0x8acdd862,
    0x29845d02, 0x9b407059, 0x5fa88156, 0x236b7231, 0x954c35ae, 0x1e55f071, 0x3b8d6944, 0x7642c86e,
    0x193646a8, 0xe6bb6191, 0x89d3d73c, 0x742c827b, 0xbaeb1856, 0x9284dcdd, 0xbf9dfc71, 0x934fc86e,
    0xadd0254d, 0xd67cf972, 0x8a74d073, 0x5020bc2e, 0x942c5f17, 0x6bbfb45e, 0x19cb195f, 0xce7fe465,
    0x1a554854, 0x62533e46, 0x7c40de4e, 0xe569e352, 0xb8dad73c, 0x1054972e, 0x7e93a57b, 0x02e10bc6,
    0x4eb2528b, 0xde160b70, 0x487799b8, 0x6b7fab75, 0xf7cce555, 0xa6afc6dd, 0x0bb2064f, 0x4a5434c9,
    0x96ea9f7b, 0xf7ab3244, 0xa24d4f05, 0x7301524a, 0x236b828a, 0xaab725b6, 0x0beb0401, 0x3144c170,
    0x84285272, 0xd8992080, 0xd8a8dacb, 0x746a1bae, 0x8fce6aaf, 0x1671d957, 0x0137d8dd, 0xc51c4150,
    0xa6ffeb58, 0xa2052077, 0x631ff671, 0xfc15b2d4, 0xe7c6404d, 0x299dfc71, 0xf098c201, 0xbda2a165,
    0x1b28b458, 0x5e1408b2, 0xa1031bbd, 0x4c4093af, 0x8deb60b1, 0xaef5055a, 0x0bb2bb46, 0x9676e36d,
    0xd14af976, 0xf7011bc5, 0xbf9af1ba, 0x9af40d56, 0xf5f57abb, 0x942ba8b2, 0x165b201f, 0xe3df1d5f,
    0xae88a56f, 0xf5131bbd, 0xd850e08c, 0x83ac4ebb, 0x36da7777, 0x48acac3b, 0x4160a8dc, 0xa496b455,
    0x4b58375f, 0x1ef9d5ba, 0xfd21b47b, 0xe07d4605, 0x5a00ca6e, 0xceabf1ba, 0xc451ed7c, 0xee4c4d7b,
    0x6b081b75, 0x0596206e, 0x0ce81dc9, 0xd6ab69ab, 0xc6d90db7, 0xb22d7059, 0x74bcdb57, 0xe4586670,
    0x0ce81dc9, 0x51b83bde, 0xe7e0ed82, 0xe5c01e4e, 0xca7492df, 0x31892002, 0x11dd7ec8, 0x06b2e16f,
    0xa7a0b032, 0x095c6670, 0x8c7ff12e, 0x5ca0b027, 0x0cf3cd2e, 0x91bab3de, 0x48cb0271, 0xb2542a48,
    0x88f0a577, 0xab11a0b4, 0xdbf7c06f, 0xd09df3a2, 0xdd63256a, 0x929b80de, 0xf492787d, 0x17132177,
    0x52855718, 0x4968cdb1, 0x36842d3b, 0x52f1a07c, 0x6ef79c3e, 0x8180ac77, 0x5b042077, 0x9050e08c,
    0xfc6f4665, 0xdcc8c56f, 0xfa708a45, 0x9884fe3e, 0x4baf728d, 0x4f9f5231, 0xfd9bcd3e, 0x14e2283b,
    0xc9cdd5ba, 0xfe9833d4, 0xd182cf1f, 0x751d1558, 0x3a74cb7b, 0x74378725, 0xc0d2dc5f, 0x8567dc57,
    0x6dc6a2b2, 0xd28f662a, 0x8c1f4f59, 0xa23e767c, 0x511304c9, 0xbf6f41ad, 0x1d5f6f4f, 0xacd9d5ba,
    0x8bf6cd2e, 0x4f903a4d, 0x5d50e08c, 0x57071979, 0x9307a43a, 0xb944c26e, 0x84f2f2de, 0x0dbdf976,
    0x585c0c6f, 0xdac3ae65, 0x7cc6eb5b, 0x2dfeac43, 0x5016c101, 0x9b4e4478, 0xfe84b455, 0x138cea7c,
    0x0b69cdb1, 0x3d9d7631, 0xe168f067, 0xaef633b0, 0x0250e08c, 0xf0332d5f, 0x177daade, 0x02ca0278,
    0x693af2bc, 0xc538d879, 0xfb529389, 0xb7d5482e, 0x983edb72, 0xd468da57, 0x0ac56aaf, 0x0f0d1979,
    0x63055272, 0x50dc164d, 0x452fd41b, 0xd2bcae65, 0xbea40244, 0xe39dd6ba, 0x97500c87, 0x7a9480de,
    0xaf052077, 0x73a9c96f, 0x9f55372e, 0x0e085353, 0x0fc767bf, 0xbe2b9e7b, 0xea8a0d51, 0x75dbfc3c,
    0xce857450, 0x48e58b50, 0x6e912002, 0x4082b455, 0x7ca9c073, 0x8661f076, 0x901ea349, 0xae25f874,
    0x54421979, 0x264d4e7c, 0xbfb0a658, 0x78ee057b, 0xcd0ab86e, 0xf4b0a56f, 0x65fdf072, 0x21500c87,
    0xde9488b4, 0xd2c6b246, 0x97215f75, 0xeb50e08c, 0xfc23da79, 0x29815553, 0x7efb1974, 0xa250e08c,
    0xec119bd3, 0x47811855, 0x1b789aa5, 0x2e081fd3, 0xd3322478, 0x8850e08c, 0xd895a57b, 0x03e2ff3a,
    0xe2e9a377, 0xcf2b41de, 0x16ebf94e, 0x9aee51b2, 0x6d8366b4, 0xc3ded5ba, 0x66a4d3d9, 0xbf5a2824,
    0xf4e2b97b, 0xbcecdfdd, 0xf1f4b3b1, 0x4141c86e, 0x0949ad6d, 0xfdeea5d5, 0x634f475f, 0xf6eb0a1b,
    0x7bc40f74, 0x85eb71b4, 0xb6d50db7, 0x3b9900dd, 0xb484d729, 0x60f0b47c, 0xd2e90a1b, 0x5333d91b
};

unsigned int pnSeedParm[] =
{
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x7532, 0x7531,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0xbccd, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x7531, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x15df,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x15df, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x15df, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x15df, 0x6ead,
    0x6ead, 0x6ead, 0x15df, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x7531, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x15df,
    0x6ead, 0x6ead, 0x15df, 0x6ead, 0x6ead, 0x15df, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x15df, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x15df, 0x6ead, 0x6ead, 0x15df,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x15df, 0x6ead, 0x6ead, 0x6ead, 0x70b4, 0x6ead, 0x15df, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x15df, 0x6ead, 0x15df, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x15df, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x03e8,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x15df, 0x15df, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x15df, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x7531, 0x6ead, 0x6ead, 0x6ead, 0x7531, 0x6ead, 0x6ead, 0x15df,
    0x6ead, 0x15df, 0x6ead, 0x03e8, 0x6ead, 0x03e8, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x15df, 0x6ead,
    0x15df, 0x15df, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x15df, 0x7531, 0x6ead, 0x15df, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x15df, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x15df, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x7531, 0x6ead, 0x6ead, 0x15df, 0x6ead, 0x15df,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x15df, 0x6ead, 0x6ead,
    0x15df, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x15df, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x15df, 0x6ead, 0x15df, 0x6ead, 0x15df,
    0x6ead, 0x6ead, 0x1f59, 0x15df, 0x6ead, 0x6ead, 0x6ead, 0x15df,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x15df, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x15df, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x15df, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x15df, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x15df, 0x15df, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x15df, 0x6ead, 0x15df, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x15df, 0x6ead, 0x6ead, 0x6ead, 0x15df,
    0x7531, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x15df, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x5ac4, 0x6ead, 0x15df, 0x6ead, 0x6ead, 0x15df, 0x6ead, 0x15df,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x15df, 0x6ead,
    0x6ead, 0x15df, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x70b4, 0x15df, 0x6ead, 0x15df, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x15df, 0x15df, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x15df, 0x6ead, 0x15df,
    0x6ead, 0x15df, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x15df, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x15df,
    0x15df, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x15df, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x15df, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x15df, 0x6ead,
    0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x6ead, 0x15df, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead, 0x6ead,
    0x15df, 0x15df, 0x6ead, 0x15df, 0x6ead, 0x6ead, 0x6ead, 0x6ead
};

class CMainParams : public CChainParams {
public:
    CMainParams() {
        // The message start string is designed to be unlikely to occur in normal data.
        // The characters are rarely used upper ASCII, not valid as UTF-8, and produce
        // a large 4-byte int at any alignment.
        pchMessageStart[0] = 0xf0;
        pchMessageStart[1] = 0xda;
        pchMessageStart[2] = 0xbb;
        pchMessageStart[3] = 0xd2;
        vAlertPubKey = ParseHex("04fc9702847840aaf195de8442ebecedf5b095cdbb9bc716bda9110971b28a49e0ead8564ff0db22209e0374782c093bb899692d524e9d6a6956e7c5ecbcd68284");
        nDefaultPort = 28333;
        nRPCPort = 28332;
        bnProofOfWorkLimit = CBigNum(~uint256(0) >> 1);
        nTxBits = 0x1e00ffff;
        nSubsidyHalvingInterval = 210000;

        // Build the genesis block. Note that the output of the genesis coinbase cannot
        // be spent as it did not originally exist in the database.
        //
        // CBlock(hash=000000000019d6, ver=1, hashPrevBlock=00000000000000, hashMerkleRoot=4a5e1e, nTime=1231006505, nBits=1d00ffff, nNonce=2083236893, vtx=1)
        //   CTransaction(hash=4a5e1e, ver=1, vin.size=1, vout.size=1, nLockTime=0)
        //     CTxIn(COutPoint(000000, -1), coinbase 04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73)
        //     CTxOut(nValue=50.00000000, scriptPubKey=0x5F1DF16B2B704C8A578D0B)
        //   vMerkleTree: 4a5e1e
        const char* pszTimestamp = "The Times 09/Jul/2013 Globo caught bribing Receita Federal employee to rob R$615M worth tax evasion documents.";
        CTransaction txNew;
        txNew.message = CScript() << string(pszTimestamp);
        txNew.userName = CScript() << string("nobody");
        txNew.nNonce  = 0; // spamMessage is not required to show POW to ease "extranonce" support
        genesis.vtx.push_back(txNew);
        genesis.hashPrevBlock = 0;
        genesis.hashMerkleRoot = genesis.BuildMerkleTree();
        genesis.nVersion = 1;
        genesis.nHeight  = 0;
        genesis.nTime    = 1384394255;
        //genesis.nBits    = 0x1d00ffff;
        genesis.nBits    = 0x1f03ffff;
        genesis.nNonce   = 2934;

        hashGenesisBlock = genesis.GetHash();
        assert(hashGenesisBlock == uint256("9915158279673d101912be80f25c20627f1dd8bf5231e7c46bfec5ed19737f44"));

        vSeeds.push_back(CDNSSeedData("twister.net.co", "seed.twister.net.co"));
        vSeeds.push_back(CDNSSeedData("gombadi.com", "dnsseed.gombadi.com"));
        vSeeds.push_back(CDNSSeedData("twister.net.co", "seed2.twister.net.co"));
        vSeeds.push_back(CDNSSeedData("twister.net.co", "seed3.twister.net.co"));
        vSeeds.push_back(CDNSSeedData("twisterseed.tk", "twisterseed.tk"));
        vSeeds.push_back(CDNSSeedData("cruller.tasty.sexy", "cruller.tasty.sexy"));
        vSeeds.push_back(CDNSSeedData("twister-seeder.muh.freedu.ms", "twister-seeder.muh.freedu.ms"));
        vSeeds.push_back(CDNSSeedData("twisterarmyseed.tk", "twisterarmyseed.tk"));
        
        base58Prefixes[PUBKEY_ADDRESS] = 0;
        base58Prefixes[SCRIPT_ADDRESS] = 5;
        base58Prefixes[SECRET_KEY] = 128;

        // Convert the pnSeeds array into usable address objects.
        for (unsigned int i = 0; i < ARRAYLEN(pnSeed); i++)
        {
            // It'll only connect to one or two seed nodes because once it connects,
            // it'll get a pile of addresses with newer timestamps.
            // Seed nodes are given a random 'last seen time' of between one and two
            // weeks ago.
            const int64 nOneWeek = 7*24*60*60;
            struct in_addr ip;
            memcpy(&ip, &pnSeed[i], sizeof(ip));
            CAddress addr(CService(ip, pnSeedParm[i]));
            addr.nTime = GetTime() - GetRand(nOneWeek) - nOneWeek;
            vFixedSeeds.push_back(addr);
        }
    }

    virtual const CBlock& GenesisBlock() const { return genesis; }
    virtual Network NetworkID() const { return CChainParams::MAIN; }

    virtual const vector<CAddress>& FixedSeeds() const {
        return vFixedSeeds;
    }
protected:
    CBlock genesis;
    vector<CAddress> vFixedSeeds;
};
static CMainParams mainParams;


//
// Testnet (v3)
//
class CTestNetParams : public CMainParams {
public:
    CTestNetParams() {
        // The message start string is designed to be unlikely to occur in normal data.
        // The characters are rarely used upper ASCII, not valid as UTF-8, and produce
        // a large 4-byte int at any alignment.
        pchMessageStart[0] = 0x0b;
        pchMessageStart[1] = 0x11;
        pchMessageStart[2] = 0x09;
        pchMessageStart[3] = 0x07;
        vAlertPubKey = ParseHex("04302390343f91cc401d56d68b123028bf52e5fca1939df127f63c6467cdf9c8e2c14b61104cf817d0b780da337893ecc4aaff1309e536162dabbdb45200ca2b0a");
        nDefaultPort = 18333;
        nRPCPort = 18332;
        strDataDir = "testnet3";

        // Modify the testnet genesis block so the timestamp is valid for a later start.
        genesis.nTime = 1296688602;
        genesis.nNonce = 414098458;
        hashGenesisBlock = genesis.GetHash();
        //assert(hashGenesisBlock == uint256("000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943"));

        vFixedSeeds.clear();
        vSeeds.clear();
        //vSeeds.push_back(CDNSSeedData("bitcoin.petertodd.org", "testnet-seed.bitcoin.petertodd.org"));
        //vSeeds.push_back(CDNSSeedData("bluematt.me", "testnet-seed.bluematt.me"));

        base58Prefixes[PUBKEY_ADDRESS] = 111;
        base58Prefixes[SCRIPT_ADDRESS] = 196;
        base58Prefixes[SECRET_KEY] = 239;

    }
    virtual Network NetworkID() const { return CChainParams::TESTNET; }
};
static CTestNetParams testNetParams;


//
// Regression test
//
class CRegTestParams : public CTestNetParams {
public:
    CRegTestParams() {
        pchMessageStart[0] = 0xfa;
        pchMessageStart[1] = 0xbf;
        pchMessageStart[2] = 0xb5;
        pchMessageStart[3] = 0xda;
        nSubsidyHalvingInterval = 150;
        bnProofOfWorkLimit = CBigNum(~uint256(0) >> 1);
        nTxBits = 0x207fffff;
        genesis.nTime = 1296688602;
        genesis.nBits = 0x207fffff;
        genesis.nNonce = 2;
        hashGenesisBlock = genesis.GetHash();
        nDefaultPort = 18444;
        strDataDir = "regtest";
        //assert(hashGenesisBlock == uint256("0x0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206"));

        vSeeds.clear();  // Regtest mode doesn't have any DNS seeds.

        base58Prefixes[PUBKEY_ADDRESS] = 0;
        base58Prefixes[SCRIPT_ADDRESS] = 5;
        base58Prefixes[SECRET_KEY] = 128;
    }

    virtual bool RequireRPCPassword() const { return false; }
    virtual Network NetworkID() const { return CChainParams::REGTEST; }
};
static CRegTestParams regTestParams;

static CChainParams *pCurrentParams = &mainParams;

const CChainParams &Params() {
    return *pCurrentParams;
}

void SelectParams(CChainParams::Network network) {
    switch (network) {
        case CChainParams::MAIN:
            pCurrentParams = &mainParams;
            break;
        case CChainParams::TESTNET:
            pCurrentParams = &testNetParams;
            break;
        case CChainParams::REGTEST:
            pCurrentParams = &regTestParams;
            break;
        default:
            assert(false && "Unimplemented network");
            return;
    }
}

bool SelectParamsFromCommandLine() {
    bool fRegTest = GetBoolArg("-regtest", false);
    bool fTestNet = GetBoolArg("-testnet", false);

    if (fTestNet && fRegTest) {
        return false;
    }

    if (fRegTest) {
        SelectParams(CChainParams::REGTEST);
    } else if (fTestNet) {
        SelectParams(CChainParams::TESTNET);
    } else {
        SelectParams(CChainParams::MAIN);
    }
    return true;
}
